<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
    // let xmlHttp =new XMLHttpRequest();
    // xmlHttp.onreadystatechange= function () {
    //     console.log('xmlHttp请求的就绪状态',xmlHttp.readyState);
    //     console.log('xmlHttp请求的响应状态',xmlHttp.status);
    //     if(xmlHttp.readyState ==4 && xmlHttp.status == 200){
    //         console.log(xmlHttp.responseText)
    //     }
    // };
    // xmlHttp.open('GET' ,'3_form.php',true);
    // xmlHttp.send();


    let xmlHttp =new XMLHttpRequest();
    xmlHttp.onreadystatechange=function () {
        console.log('xmlHttp请求的就绪状态',xmlHttp.readyState);
        console.log('xmlHttp响应的状态',xmlHttp.status);
        if(xmlHttp.readyState ==4 && xmlHttp.status == 200){
           console.log(xmlHttp.responseText);
        }
    };
        xmlHttp.open('POST', '/3_form.php',true);
        xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        xmlHttp.send('name=小明&age=18 &sex=男');

</script>
</body>
</html>